#ifndef GRASS_H
#define GRASS_H

#include "D3dUtil.h"

class Grass
{
public:
	Grass();
	~Grass();

	void OnResetDevice();
	void OnLostDevice();
	void Draw(D3DXMATRIX &mView, D3DXMATRIX &mProj, D3DXVECTOR3 &cPos, float currentTime);
	void Update(float dt);

private:
	void BuildGrassBuffers(int& indexOffset, D3DXVECTOR3& worldPos, D3DXVECTOR3& scale);

	//ID3DXMesh* mGrassMesh;
	ID3DXMesh* mGrassMesh;
	IDirect3DTexture9* mGrassTex;

	// Grass FX
	ID3DXEffect* mGrassFX;
	D3DXHANDLE mhGrassTech;
	D3DXHANDLE mhGrassViewProj;
	D3DXHANDLE mhGrassTex;
	D3DXHANDLE mhGrassTime;
	D3DXHANDLE mhGrassEyePosW;
	D3DXHANDLE mhGrassDirToSunW;

	ID3DXBuffer* errors;
};

#endif